package com.ssy.lingxi.order.model.vo.basic.request;

import com.ssy.lingxi.order.handler.annotation.DeliveryTypeAnnotation;
import com.ssy.lingxi.order.handler.annotation.FreightTypeAnnotation;
import com.ssy.lingxi.order.handler.annotation.OrderProductPriceTypeAnnotation;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 新增订单商品接口参数
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-17
 */
public class OrderProductVO implements Serializable {
    private static final long serialVersionUID = -1656500906007788421L;

    /**
     * 供应商会员Id
     */
    @NotNull(message = "供应商会员Id要大于0")
    @Positive(message = "供应商会员Id要大于0")
    private Long vendorMemberId;

    /**
     * 供应商会员角色Id
     */

    @NotNull(message = "供应商会员角色Id要大于0")
    @Positive(message = "供应商会员角色Id要大于0")
    private Long vendorRoleId;

    /**
     * 供应商会员名称
     */
    @NotBlank(message = "供应商会员名称不能为空")
    @Size(max = 200, message = "供应商会员名称最长200个字符")
    private String vendorMemberName;

    /**
     * 上游供应商会员Id
     */
    private Long supplyMemberId;

    /**
     * 上游供应商会员角色Id
     */
    private Long supplyRoleId;

    /**
     * 上游供应商会员名称
     */
    @Size(max = 200, message = "上游供应商会员名称最长200个字符")
    private String supplyMemberName;

    /**
     * 商品Id
     */
    @NotNull(message = "商品Id要大于0")
    @Positive(message = "商品Id要大于0")
    private Long productId;

    /**
     * 商品SkuId
     */
    @NotNull(message = "商品SkuId要大于0")
    @Positive(message = "商品SkuId要大于0")
    private Long skuId;

    /**
     * 渠道商品库存Id
     */
    private Long stockId;

    /**
     * 购物车Id
     */
    private Long cartId;

    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空")
    @Size(max = 100, message = "商品名称最长100个字符")
    private String name;

    /**
     * 商品品类
     */
    @NotBlank(message = "商品品类不能为空")
    @Size(max = 50, message = "商品品类最长50个字符")
    private String category;

    /**
     * 商品品牌
     */
    @Size(max = 50, message = "商品品牌最长50个字符")
    private String brand;

    /**
     * 计价单位
     */
    @NotBlank(message = "商品计价单位不能为空")
    @Size(max = 10, message = "商品计价单位最长10个字符")
    private String unit;

    /**
     * 商品Logo Url
     */
    @NotBlank(message = "商品Logo不能为空")
    @Size(max = 400, message = "商品Logo最长400个字符")
    private String logo;

    /**
     * 商品规格
     */
    @Size(max = 255, message = "商品规格最长255个字符")
    private String spec;

    /**
     * 商品价格类型，1-现货价格，2-询价价格，3-积分兑换，4-赠品
     */
    @NotNull(message = "商品价格类型不能为空：1-现货价格，2-询价价格，3-积分兑换，4-赠品")
    @OrderProductPriceTypeAnnotation
    private Integer priceType;

    /**
     * 商品价格
     */
    @NotNull(message = "商品价格要大于等于0")
    @PositiveOrZero(message = "商品价格要大于等于0")
    private BigDecimal price;

    /**
     * 会员折扣（百分比的分子部分）
     */
    @Min(value = 0, message = "会员折扣取值范围为 0-1")
    @Max(value = 1, message = "会员折扣取值范围为 0-1")
    private BigDecimal discount;

    /**
     * 采购数量
     */
    @NotNull(message = "采购数量要大于0")
    @Positive(message = "采购数量要大于0")
    private BigDecimal quantity;

    /**
     * 供方库存
     */
    @Max(value = 1000000000, message = "供方库存不能超过10亿")
    private BigDecimal stock;

    /**
     * 是否含税（true-含税，false-不含税）
     */
    private Boolean tax;

    /**
     * 税率（百分比的分子部分）
     */
    private BigDecimal taxRate;

    /**
     * 商品配送方式：1-物流，2-自提，3-无需配送
     */
    @NotNull(message = "商品配送方式不能为空")
    @DeliveryTypeAnnotation
    private Integer deliveryType;

    /**
     * 运费类型，1-卖家承担，2-买家承担
     */
    @FreightTypeAnnotation
    private Integer freightType;

    /**
     * 商品重量，当配送方式是物流时要非空且大于0
     */
    private BigDecimal weight;

    /**
     * 物流模板Id，当配送方式是物流时要非空且大于0
     */
    private Long logisticsTemplateId;

    /**
     * 自提地址（如配送方式为自提，必填）
     */
    @Size(max = 200, message = "自提地址最长200个字符")
    private String address;

    /**
     * 接收人（如配送方式为自提，必填）
     */
    @Size(max = 50, message = "接收人最长50个字符")
    private String receiver;

    /**
     * 接收人电话（如配送方式为自提，必填）
     */
    @Size(max = 20, message = "接收人最长20个字符")
    private String phone;

    /**
     * 是否跨境商品
     */
    private Boolean isCrossBorder;

    public Long getVendorMemberId() {
        return vendorMemberId;
    }

    public void setVendorMemberId(Long vendorMemberId) {
        this.vendorMemberId = vendorMemberId;
    }

    public Long getVendorRoleId() {
        return vendorRoleId;
    }

    public void setVendorRoleId(Long vendorRoleId) {
        this.vendorRoleId = vendorRoleId;
    }

    public String getVendorMemberName() {
        return vendorMemberName;
    }

    public void setVendorMemberName(String vendorMemberName) {
        this.vendorMemberName = vendorMemberName;
    }

    public Long getSupplyMemberId() {
        return supplyMemberId;
    }

    public void setSupplyMemberId(Long supplyMemberId) {
        this.supplyMemberId = supplyMemberId;
    }

    public Long getSupplyRoleId() {
        return supplyRoleId;
    }

    public void setSupplyRoleId(Long supplyRoleId) {
        this.supplyRoleId = supplyRoleId;
    }

    public String getSupplyMemberName() {
        return supplyMemberName;
    }

    public void setSupplyMemberName(String supplyMemberName) {
        this.supplyMemberName = supplyMemberName;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Long getStockId() {
        return stockId;
    }

    public void setStockId(Long stockId) {
        this.stockId = stockId;
    }

    public Long getCartId() {
        return cartId;
    }

    public void setCartId(Long cartId) {
        this.cartId = cartId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getPriceType() { return priceType; }

    public void setPriceType(Integer priceType) { this.priceType = priceType; }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public BigDecimal getQuantity() {
        return quantity;
    }

    public void setQuantity(BigDecimal quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getStock() {
        return stock;
    }

    public void setStock(BigDecimal stock) {
        this.stock = stock;
    }

    public Boolean getTax() {
        return tax;
    }

    public void setTax(Boolean tax) {
        this.tax = tax;
    }

    public BigDecimal getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(BigDecimal taxRate) {
        this.taxRate = taxRate;
    }

    public Integer getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(Integer deliveryType) {
        this.deliveryType = deliveryType;
    }

    public Integer getFreightType() {
        return freightType;
    }

    public void setFreightType(Integer freightType) {
        this.freightType = freightType;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public Long getLogisticsTemplateId() {
        return logisticsTemplateId;
    }

    public void setLogisticsTemplateId(Long logisticsTemplateId) {
        this.logisticsTemplateId = logisticsTemplateId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Boolean getCrossBorder() {
        return isCrossBorder;
    }

    public void setCrossBorder(Boolean crossBorder) {
        isCrossBorder = crossBorder;
    }
}
